package com.hl233.framework.thread;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author 张振强15065206763
 * @create 2024-09-06
 */
public class BreadStore {

    public static final BlockingQueue<String> BREAD_STORE = new LinkedBlockingQueue<>();

    //寄售面包
    public static void put(String str) {
        try {
            BREAD_STORE.put(str);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    //售出面包
    public static String take() {
        try {
            return BREAD_STORE.take();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return null;
    }
}
